home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / Open Prolog / Release Notes < prev   
Text File  |  1994-03-22  |  8KB  |  95 lines

  1. Version 1.0.2
  2.  
  3. Big News
  4. • Open Prolog runs on the PowerPC Macs. Hold on,though, it runs in emulated mode, so it doesn't exactly race along. To be exact, on a prerelease 8100/80, it ran naive reverse at 21kLips (about three times a IIx). All the same, it's heartening.
  5.  
  6. • New features.
  7. Many big changes have occured beneath the surface of Open Prolog - all for the better, and all compatible with previous versions.
  8.  
  9. - Many of Open Prolog's built-in predicates are themselves written in Prolog and compiled. The biggest internal change has been a significant revision to the compiler, linker and loader which collectively had a 64 kByte limit, causing much grief. This limit has now been removed, and the loading procedures have been modified to offer greater flexibility.
  10.  
  11. - Open Prolog checks a special folder, called Open Prolog Additions, in the Extensions Folder (or the System Folder in System 6). External Predicates,  separately compiled Prolog code, and other Macintosh Resources can be placed in Open Prolog extension files. These files have a distinctive Open Prolog icon and, if placed in the Open Prolog Additions Folder, are opened for use at startup. In addition, if a file called 'Open Prolog Options' can't be found in the Startup Folder, it will be consulted if it's present in Open Prolog Additions.
  12. There are two extension files with this release of Open Prolog:
  13. 'Environment' implements a suggestion of Richard O'Keeffe's providing details of the Prolog environment in a standard way by making calls to environment/1. (The idea is his, the bugs are ours.)
  14. 'debugStartAction' prints the date and time at the start of a trace session.
  15.  
  16. - A new way of specifying files and folders, based on the Macintosh File Specification, has been developed.
  17.  
  18. The full, canonical, specification of a folder is now:
  19. folder(VolumeNumber,IndexNumber).
  20. A number of standard folders have special 4-letter abbreviations, and these abbreviations can be used instead of the folder specification given above. The four standard folder abbreviations supported directly by Open Prolog are: 
  21. 'Strt' - Startup Folder. This is the folder containing Open Prolog itself.
  22. 'Home' - Home Folder. This is the folder initially containing the Open Prolog Worksheet you're using.
  23. 'Addn' - Additions Folder. This is the folder 'Open Prolog Additions' contained in the Extensions Folder (the System Folder for System 6).
  24. 'Curr' - Current Folder. Initially the Home Folder, this can be set using the set_folder predicate.
  25. Under System 7, Open Prolog also recognises all System 7 abbreviations for special folders, including such useful ones as 'desk' for the desktop, 'macs' for the System Folder, 'temp' for the Temporary Items folder, and many others. 
  26.  
  27. The canonical specification of a file is now:
  28. file(<FolderSpecification>,Name)
  29. where <FolderSpecification> is as described above. Whenever a file is to be used, the specification you give is resolved to the canonical form, and is then used.
  30. If you specify a file simply by giving its name, then it is expected to be in the current folder. Partial pathnames and full pathnames are resolved correctly.
  31.  
  32.  
  33. - New file handling predicates. These are based loosely on some of the ISO draft I/O predicates and use the new file specification scheme described above. Note that the name of standard input and output is simply 'user', not 'user_input' or 'user_output'.
  34.  
  35. The new predicates are:
  36.  
  37. open(FileSpec,Mode,Stream)
  38.       FileSpec is anything sensible, e.g. a full file specification, just an name,
  39.       or a folder and name
  40.       Mode is read, write or append
  41.       Stream is either an automatically generated Stream ID - an integer - or an atom
  42.         of your choosing (the atom mustn't be the Stream ID of another stream).
  43.      The file specified is opened, but the stream doesn't become the current input or
  44.      output stream automatically.
  45.  
  46. close(Stream)
  47.  
  48. set_input(Stream)
  49.  
  50. set_output(Stream)
  51.  
  52. current_input(Stream)
  53.  
  54. current_output(Stream)
  55.  
  56. canonicalFileSpec(FileDescription,FileSpec).
  57. returns the canonical specification of the item described in the FileDescription. If the item is a folder, then a canonical folder description is returned. If the item is a file, the canonical file description is returned, including the file's name correctly capitalised just as it appears in the finder. 
  58. NOTE - the File or folder must exist!
  59.  
  60. stream_property(Stream,Property).
  61. Properties currently disclosed are: file_name(Name), file_spec(FileSpec), position(N), size(Size), reposition(false), type(text), eof_action(error), mode(Mode).
  62.  
  63. fileerrors - enables reporting of file errors
  64.  
  65. nofileerrors - disables reporting of file errors.
  66.  
  67. If errors occur and fileerrors are enabled, the error terms are thrown.
  68. If errors occur when fileerrors are disabled, the predicates fail quietly.
  69.  
  70. - New window handling predicates.
  71.  
  72. open_window(FileSpec,Window,CloseAction)
  73. The file specified is opened into the Window whose index number is returned. The normal close action to specify is confirm_close - the user will then be asked whether to save a changed window before closure. If you specify dont_confirm_close, the file will be saved automatically on closure.
  74. If the file is already open in a window, no new window is opened; instead the old window is brought to the front.
  75.  
  76. window_property(Window,Property).
  77. This is modelled on stream_property/2 and discloses the following properties: window_name(Name) file_attached(Boolean) file_spec(FileSpec)  file_and_window_contents_match(Boolean) (this will be false if the window is 'dirty'). The last two properties are not disclosed if no file is attached.
  78.  
  79. read_with_progress(X)
  80. This predicate reads a term from the current input source, and (if it's not 'user') sets the progress indicator to the ratio of position to stream size. Note that it doesn't cause the progress indicator to be made visible. You should show it beforehand and hide it afterwards. The number of calls to hide the progress indicator should balance the number of calls to show it.
  81.  
  82. Bug Fixes & Improvements
  83. • Some changes have been made to the handling of unexpected end of file conditions, to try to improve error detection.
  84. • On Quadra 660AVs, OP seemed to run out of scratch memory. This has been cured by increasing the amount of scratch memory reserved at startup. OP is not smart about memory demands for opening windows or consulting documents; if there isn't enough memory allocated, OP is unable to get any more and may get into trouble as a consequence.
  85. • Sometimes, in System 7, OP didn't figure out which folder was the current folder. This bug has been present in all versions that run under System 7, and may have been the cause of some mysterious problems.
  86. • When a file is being consulted or reconsulted, all directives - goals preceded by :-, are executed. This idea is now extended to include calls preceded by ?-, so that goals preceded by ?- in a file being consulted or reconsulted will also be executed.
  87. • A bug which crashed the machine when a quote was preceded by a digit and followed by other than a digit was fixed. The bug was introduced when OP became capable of using bases other than 10.
  88. • OP now recognises a number specification of the form 0'<character> as being an integer whose value is the character code of <character>. For example, if you entered:
  89. X is 0'a.
  90. you'd get X = 97 (the character code for 'a').
  91. • OP has stopped complaining about an empty list with white space in it.
  92. • Sometimes it is impossible to assert a given clause, either because an attempt is made to redefine a built-in predicate or because some part of the body is illegal (e.g. an integer call). OP now (at least) reports the clause and the kind of error.
  93. • OP would only consult or reconsult an open window if the file in the window happened to be in the home folder. This restriction has been removed.
  94. • If a file is open in a window, OP will ask you if it's OK to close it if it's to be written to, and will ask you if it's OK to save it before opening it for reading.
  95.